<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Compiling GMime Applications: GMime 3.0 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GMime 3.0 Reference Manual">
<link rel="up" href="gmime.html" title="Part I. GMime Overview">
<link rel="prev" href="gmime-building.html" title="Compiling the GMime libraries">
<link rel="next" href="gmime-changes-2-0.html" title="Changes from 1.0 to 2.0">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="gmime.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gmime-building.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gmime-changes-2-0.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gmime-compiling"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">Compiling GMime Applications</span></h2>
<p>Compiling GMime Applications — 
How to compile your GMime application
</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="id-1.2.4.3"></a><h2>Compiling GMime Applications on UNIX</h2>
<p>
To compile a GMime application, you need to tell the compiler where to 
find the GMime header files and libraries. This is done with the
<code class="literal">pkg-config</code> utility.
</p>
<p>
The following interactive shell session demonstrates how
<code class="literal">pkg-config</code> is used:
</p>
<pre class="programlisting">
$ pkg-config --cflags gmime-3.0
 -I/usr/include/gmime-3.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 
$ pkg-config --libs gmime-3.0
 -L/opt/gnome2/lib -lgmime-3.0 -lnsl -lgobject-2.0 -lglib-2.0
</pre>
<p>
</p>
<p>
The simplest way to compile a program is to use the "backticks"
feature of the shell. If you enclose a command in backticks
(<span class="emphasis"><em>not single quotes</em></span>), then its output will be
substituted into the command line before execution. So to compile 
a GTK+ Hello, World, you would type the following:
</p>
<pre class="programlisting">
$ cc `pkg-config --cflags --libs gmime-3.0` hello.c -o hello
</pre>
<p>
</p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>